/*
 * qiangungun.com Inc.
 * Copyright (c) 2014 All Rights Reserved.
 */package com.qiangungun.report.dal.ibatis;import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;import com.qiangungun.report.dal.daointerface.RptcfgDefineDAO;// auto generated importsimport java.util.List;import org.springframework.dao.DataAccessException;import com.qiangungun.report.dal.dataobject.RptcfgDefineDO;/** * An ibatis based implementation of dao interface <tt>com.qiangungun.report.dal.daointerface.RptcfgDefineDAO</tt>. * * This file is generated by <tt>financenet-dalgen</tt>, a DAL (Data Access Layer)
 * code generation utility specially developed for <tt>iwallet</tt> project.
 * 
 * PLEASE DO NOT MODIFY THIS FILE MANUALLY, or else your modification may
 * be OVERWRITTEN by someone else. To modify the file, you should go to 
 * directory <tt>(project-home)/biz/dal/src/conf/dalgen</tt>, and 
 * find the corresponding configuration file (<tt>tables/rptcfg_define.xml</tt>). 
 * Modify the configuration file according to your needs, then run <tt>financenet-dalgen</tt> 
 * to generate this file.
 *
 */@SuppressWarnings({"unchecked","deprecation"})public class IbatisRptcfgDefineDAO extends SqlMapClientDaoSupport implements RptcfgDefineDAO {	/**
	 *  Query DB table <tt>rptcfg_define</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, CATALOG_ID, DEFINE_CODE, DEFINE_NAME, DEFINE_TITLE, CREATE_TIME, STATUS, NOTE from rptcfg_define</tt>
	 *
	 *	@return List<RptcfgDefineDO>
	 *	@throws DataAccessException
	 */	 
    public List<RptcfgDefineDO> loadAll() throws DataAccessException {

        return getSqlMapClientTemplate().queryForList("MS-RPTCFG-DEFINE-LOAD-ALL", null);

    }		/**
	 *  Query DB table <tt>rptcfg_define</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, CATALOG_ID, DEFINE_CODE, DEFINE_NAME, DEFINE_TITLE, CREATE_TIME, STATUS, NOTE from rptcfg_define where (DEFINE_CODE = ?)</tt>
	 *
	 *	@param defineCode
	 *	@return RptcfgDefineDO
	 *	@throws DataAccessException
	 */	 
    public RptcfgDefineDO queryByDefineCode(String defineCode) throws DataAccessException {

        return (RptcfgDefineDO) getSqlMapClientTemplate().queryForObject("MS-RPTCFG-DEFINE-QUERY-BY-DEFINE-CODE", defineCode);

    }		/**
	 *  Query DB table <tt>rptcfg_define</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, CATALOG_ID, DEFINE_CODE, DEFINE_NAME, DEFINE_TITLE, CREATE_TIME, STATUS, NOTE from rptcfg_define where (ID = ?)</tt>
	 *
	 *	@param id
	 *	@return RptcfgDefineDO
	 *	@throws DataAccessException
	 */	 
    public RptcfgDefineDO queryById(Long id) throws DataAccessException {

        return (RptcfgDefineDO) getSqlMapClientTemplate().queryForObject("MS-RPTCFG-DEFINE-QUERY-BY-ID", id);

    }		/**
	 *  Insert one <tt>RptcfgDefineDO</tt> object to DB table <tt>rptcfg_define</tt>, return primary key
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>insert into rptcfg_define(ID,CATALOG_ID,DEFINE_CODE,DEFINE_NAME,DEFINE_TITLE,CREATE_TIME,STATUS,NOTE) values (?, ?, ?, ?, ?, ?, ?, ?)</tt>
	 *
	 *	@param rptcfgDefine
	 *	@return Long
	 *	@throws DataAccessException
	 */	 
    public Long insert(RptcfgDefineDO rptcfgDefine) throws DataAccessException {
    	if (rptcfgDefine == null) {
    		throw new IllegalArgumentException("Can't insert a null data object into db.");
    	}
    	
        getSqlMapClientTemplate().insert("MS-RPTCFG-DEFINE-INSERT", rptcfgDefine);

        return rptcfgDefine.getId();
    }		/**
	 *  Delete records from DB table <tt>rptcfg_define</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>delete from rptcfg_define where (ID = ?)</tt>
	 *
	 *	@param rptcfgDefine
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int delete(RptcfgDefineDO rptcfgDefine) throws DataAccessException {
    	if (rptcfgDefine == null) {
    		throw new IllegalArgumentException("Can't delete by a null data object.");
    	}


        return getSqlMapClientTemplate().delete("MS-RPTCFG-DEFINE-DELETE", rptcfgDefine);
    }	/**
	 *  Update DB table <tt>rptcfg_define</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>update rptcfg_define set CATALOG_ID=?, DEFINE_CODE=?, DEFINE_NAME=?, DEFINE_TITLE=?, CREATE_TIME=?, STATUS=?, NOTE=? where (ID = ?)</tt>
	 *
	 *	@param rptcfgDefine
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int update(RptcfgDefineDO rptcfgDefine) throws DataAccessException {
    	if (rptcfgDefine == null) {
    		throw new IllegalArgumentException("Can't update by a null data object.");
    	}


        return getSqlMapClientTemplate().update("MS-RPTCFG-DEFINE-UPDATE", rptcfgDefine);
    }	}	